package com.tuling.stu.dao.order;

import org.springframework.stereotype.Repository;

import com.tuling.stu.base.dao.AbstractBaseDao;
import com.tuling.stu.entity.order.TTransation;

@Repository
public class TransationDao extends AbstractBaseDao {
	
	
	public Long insertOrder(TTransation obj) throws Exception {
		return insertAndReturnLongId(obj, "t_transaction", "tranId", true);
	}
	
	public boolean updateApplyOrderStatus(TTransation apply) {
		String sql = "update t_transaction set status = ? where status = 1 and tran_id = ?";
		int i = jdbcTemplate.update(sql, new Object[]{apply.getStatus(), apply.getTranId()});
		
		return i > 0;
	}
	
}
